package com.ac.service;

import com.ac.dao.DeviceDao;
import com.ac.entity.Device;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceService {

    @Autowired
    private DeviceDao deviceDao;

    public List<Device> queryDevice(Integer buildingId,int startIndex,
                                    int pageRows){
        return deviceDao.queryDevice(buildingId,startIndex,pageRows);
    }

    public int queryDeviceCount(Integer buildingId){
        return deviceDao.queryDeviceCount(buildingId);
    }

    public void updateStatus(Device device){
        deviceDao.updateStatus(device);
    }

    public void add(Device device){
        deviceDao.add(device);
    }
}
